package rlyy.framework.core.common.exception;


import rlyy.framework.core.common.enums.ExceptionEnum;

/**
 * @author yuanqinglong
 * @since 2020/7/13 10:03
 */
public abstract class BaseRuntimeException extends RuntimeException {

    private static final long serialVersionUID = -6478205165221527774L;

    private String errCode;

    public BaseRuntimeException() {
    }

    public BaseRuntimeException(ExceptionEnum msg) {
        super(msg.getMsg());
        this.errCode = msg.getCode()+"";
    }

    public BaseRuntimeException(String msg) {
        super(msg);
    }

    public BaseRuntimeException(String message, Throwable cause) {
        super(message, cause);
    }

    public BaseRuntimeException(Throwable cause) {
        super(cause);
    }

    public BaseRuntimeException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

    public String getCode(){
        return this.errCode;
    }
}
